#ifndef HAM_LOGBOOK_H
#define HAM_LOGBOOK_H

#include <QtGui/QStandardItemModel>
#include "../../Core/Main/Module.h"
#include "ui_Logbook_Main.h"

#include "../Database/QSOEntry.h"

namespace ham
{
	class WdgOptions;
	class WdgLogEntry;

	class Logbook
		: public Module, public Ui::Logbook_Main
	{
		Q_OBJECT

	public:
		Logbook(QWidget*);
		~Logbook(void);

		QString	getModuleName() const;
		QString getDisplayName() const;
		bool isInit() const;
		
		WdgOptions* getOptionsWdg(QWidget*);
		QList<QMenu*> getMenus(QWidget*) const;
		QList<QPair<QString, QWidget*>> getMainWidgets(QWidget*);
		QList<QPair<QString, QWidget*>> getToolbarWidgets(QWidget*);

	public slots:
		void addNewEntry(int);
		void closeLogEntry(int);
		void showLogEntries(bool);
		void changeTabName(QString, const WdgLogEntry*);

	protected:
		bool iInit();
		
	private:
		void initDatabaseLayout();

		QWidget*	m_tabBarCloseButton;

	};
}

#endif // HAM_LOGBOOK_H